﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xfs
{
    [XfsObjectSystem]
    public class XfsPropertyComponentStartSystem : XfsStartSystem<XfsPropertyComponent>
    {
        public override void Start(XfsPropertyComponent self)
        {


        }
    }

    [XfsObjectSystem]
    public class XfsPropertyComponentUpdateSystem : XfsUpdateSystem<XfsPropertyComponent>
    {
        public override void Update(XfsPropertyComponent self)
        {

        }
    }

    public static class XfsPropertyComponentHelper
    {
        public static void GetLevelProperty(this XfsPropertyComponent self, int level = 1)
        {
            //XfsRoler roler = self.GetParent<XfsRoler>();

            //if (roler == null) return;

            //if (roler.Level == null)
            //{
            //    roler.Level = level;
            //}

            //self.Stamina += roler.Level;
            //self.Brains += roler.Level;
            //self.Power += roler.Level;
            //self.Agility += roler.Level;
        }

        //public static void GetLevelProperty(this XfsPropertyComponent self, Tribe tribe = Tribe.Administration, int level = 1)
        //{
        //    XfsRoler roler = self.GetParent<XfsRoler>();

        //    if (roler == null) return;

        //    if (roler.Tribe == null)
        //    {
        //        roler.Tribe = tribe;
        //    }

        //    if (roler.Level == null)
        //    {
        //        roler.Level = level;
        //    }

        //    switch (roler.Tribe)
        //    {
        //        case Tribe.Administration:
        //            self.Stamina = 10;
        //            self.Brains = 10;
        //            self.Power = 6;
        //            self.Agility = 14;
        //            break;
        //        case Tribe.Valuation:
        //            self.Stamina = 10;
        //            self.Brains = 10;
        //            self.Power = 14;
        //            self.Agility = 6;
        //            break;
        //        case Tribe.Metering:
        //            self.Stamina = 6;
        //            self.Brains = 14;
        //            self.Power = 10;
        //            self.Agility = 10;
        //            break;
        //        case Tribe.Case:
        //            self.Stamina = 14;
        //            self.Brains = 16;
        //            self.Power = 10;
        //            self.Agility = 10;
        //            break;
        //    }

        //    self.Stamina += roler.Level;
        //    self.Brains += roler.Level;
        //    self.Power += roler.Level;
        //    self.Agility += roler.Level;
        //}

        public static void GetProperty(this XfsPropertyComponent self)
        {
            //XfsRoler? roler = self.GetParent<XfsRoler>();

            //if (roler == null) return;

            //self.MaxHp = 10 * self.Stamina * (int)roler.RoleCLass;
            //self.MaxMp = 10 * roler.Level * (int)roler.RoleCLass;
            //self.Bp = self.Brains * (int)roler.RoleCLass;
            //self.Ap = self.Power * (int)roler.RoleCLass;

            //self.Hr = (self.Power + self.Agility) * (int)roler.RoleCLass;
            //self.Cr = (self.Power + self.Agility) * (int)roler.RoleCLass;
            //self.Sp = (self.Power + self.Agility) * (int)roler.RoleCLass;
            //self.Dp = (self.Power + self.Agility) * (int)roler.RoleCLass;
        }




    }
}
